package red.mlz.consoleconsumer.feign.category;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "game-service", contextId = "category")
public interface CategoryFeign {

    @RequestMapping("/game-service/category/edit")
    Long edit(@RequestParam(name = "categoryId") Long categoryId,
                     @RequestParam(name = "name")String name,
                     @RequestParam(name = "image")String image,
                     @RequestParam(name = "parentId",required = false)Long parentId);

    @RequestMapping("/game-service/category/tree")
    Map<String, Object> getCategoryTree();

    @RequestMapping("/game-service/category/add")
    String addCategory(@RequestParam(name = "categoryId",required = false) Long categoryId,
                              @RequestParam(name = "name") String name,
                              @RequestParam(name = "image") String image,
                              @RequestParam(name = "parentId") Long parentId);

    @RequestMapping("/game-service/category/update")
    String updateCategory(@RequestParam(name = "categoryId") Long categoryId,
                                 @RequestParam(name = "name") String name,
                                 @RequestParam(name = "image") String image,
                                 @RequestParam(name = "parentId") Long parentId);

    @RequestMapping("/game-service/category/delete")
    Integer deleteCategory(@RequestParam(name = "categoryId") Long categoryId);
}
